﻿
/******************************************************************
* 表名：TabBook
* 时间：2010-4-16 17:12:09
* Made by Codematic
******************************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_Exists]
GO
------------------------------------
--用途：是否已经存在 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_Exists
@BookID int
AS
	DECLARE @TempID int
	SELECT @TempID = count(1) FROM [TabBook] WHERE BookID=@BookID 
	IF @TempID = 0
		RETURN 0
	ELSE
		RETURN 1

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_ADD]
GO
------------------------------------
--用途：增加一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_ADD
@BookID int output,
@BookName nvarchar(100),
@BookNumber nvarchar(50),
@TypeID int,
@StateID int,
@BookAuther nvarchar(150),
@BookPublicTime nvarchar(50),
@BookPrice decimal(18,0),
@IsDisk nvarchar(50),
@Remark nvarchar(250)

 AS 
	INSERT INTO [TabBook](
	[BookName],[BookNumber],[TypeID],[StateID],[BookAuther],[BookPublicTime],[BookPrice],[IsDisk],[Remark]
	)VALUES(
	@BookName,@BookNumber,@TypeID,@StateID,@BookAuther,@BookPublicTime,@BookPrice,@IsDisk,@Remark
	)
	SET @BookID = @@IDENTITY

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_Update]
GO
------------------------------------
--用途：修改一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_Update
@BookID int,
@BookName nvarchar(100),
@BookNumber nvarchar(50),
@TypeID int,
@StateID int,
@BookAuther nvarchar(150),
@BookPublicTime nvarchar(50),
@BookPrice decimal(18,0),
@IsDisk nvarchar(50),
@Remark nvarchar(250)
 AS 
	UPDATE [TabBook] SET 
	[BookName] = @BookName,[BookNumber] = @BookNumber,[TypeID] = @TypeID,[StateID] = @StateID,[BookAuther] = @BookAuther,[BookPublicTime] = @BookPublicTime,[BookPrice] = @BookPrice,[IsDisk] = @IsDisk,[Remark] = @Remark
	WHERE BookID=@BookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_Delete]
GO
------------------------------------
--用途：删除一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_Delete
@BookID int
 AS 
	DELETE [TabBook]
	 WHERE BookID=@BookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_GetModel]
GO
------------------------------------
--用途：得到实体对象的详细信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_GetModel
@BookID int
 AS 
	SELECT 
	BookID,BookName,BookNumber,TypeID,StateID,BookAuther,BookPublicTime,BookPrice,IsDisk,Remark
	 FROM [TabBook]
	 WHERE BookID=@BookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBook_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBook_GetList]
GO
------------------------------------
--用途：查询记录信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:12:09
------------------------------------
CREATE PROCEDURE UP_TabBook_GetList
 AS 
	SELECT 
	BookID,BookName,BookNumber,TypeID,StateID,BookAuther,BookPublicTime,BookPrice,IsDisk,Remark
	 FROM [TabBook]

GO
/******************************************************************
* 表名：TabBookState
* 时间：2010-4-16 17:14:51
* Made by Codematic
******************************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_Exists]
GO
------------------------------------
--用途：是否已经存在 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_Exists
@StateID int
AS
	DECLARE @TempID int
	SELECT @TempID = count(1) FROM [TabBookState] WHERE StateID=@StateID 
	IF @TempID = 0
		RETURN 0
	ELSE
		RETURN 1

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_ADD]
GO
------------------------------------
--用途：增加一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_ADD
@StateID int output,
@StateName nvarchar(50)

 AS 
	INSERT INTO [TabBookState](
	[StateName]
	)VALUES(
	@StateName
	)
	SET @StateID = @@IDENTITY

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_Update]
GO
------------------------------------
--用途：修改一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_Update
@StateID int,
@StateName nvarchar(50)
 AS 
	UPDATE [TabBookState] SET 
	[StateName] = @StateName
	WHERE StateID=@StateID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_Delete]
GO
------------------------------------
--用途：删除一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_Delete
@StateID int
 AS 
	DELETE [TabBookState]
	 WHERE StateID=@StateID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_GetModel]
GO
------------------------------------
--用途：得到实体对象的详细信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_GetModel
@StateID int
 AS 
	SELECT 
	StateID,StateName
	 FROM [TabBookState]
	 WHERE StateID=@StateID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookState_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookState_GetList]
GO
------------------------------------
--用途：查询记录信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:14:51
------------------------------------
CREATE PROCEDURE UP_TabBookState_GetList
 AS 
	SELECT 
	StateID,StateName
	 FROM [TabBookState]

GO

/******************************************************************
* 表名：TabBookType
* 时间：2010-4-16 17:16:37
* Made by Codematic
******************************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_Exists]
GO
------------------------------------
--用途：是否已经存在 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_Exists
@TypeID int
AS
	DECLARE @TempID int
	SELECT @TempID = count(1) FROM [TabBookType] WHERE TypeID=@TypeID 
	IF @TempID = 0
		RETURN 0
	ELSE
		RETURN 1

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_ADD]
GO
------------------------------------
--用途：增加一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_ADD
@TypeID int output,
@TypeName nvarchar(50),
@Remark nvarchar(250)

 AS 
	INSERT INTO [TabBookType](
	[TypeName],[Remark]
	)VALUES(
	@TypeName,@Remark
	)
	SET @TypeID = @@IDENTITY

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_Update]
GO
------------------------------------
--用途：修改一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_Update
@TypeID int,
@TypeName nvarchar(50),
@Remark nvarchar(250)
 AS 
	UPDATE [TabBookType] SET 
	[TypeName] = @TypeName,[Remark] = @Remark
	WHERE TypeID=@TypeID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_Delete]
GO
------------------------------------
--用途：删除一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_Delete
@TypeID int
 AS 
	DELETE [TabBookType]
	 WHERE TypeID=@TypeID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_GetModel]
GO
------------------------------------
--用途：得到实体对象的详细信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_GetModel
@TypeID int
 AS 
	SELECT 
	TypeID,TypeName,Remark
	 FROM [TabBookType]
	 WHERE TypeID=@TypeID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBookType_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBookType_GetList]
GO
------------------------------------
--用途：查询记录信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:16:37
------------------------------------
CREATE PROCEDURE UP_TabBookType_GetList
 AS 
	SELECT 
	TypeID,TypeName,Remark
	 FROM [TabBookType]

GO
/******************************************************************
* 表名：TabBorrowBooks
* 时间：2010-4-16 17:17:46
* Made by Codematic
******************************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_Exists]
GO
------------------------------------
--用途：是否已经存在 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_Exists
@BorrowBookID int
AS
	DECLARE @TempID int
	SELECT @TempID = count(1) FROM [TabBorrowBooks] WHERE BorrowBookID=@BorrowBookID 
	IF @TempID = 0
		RETURN 0
	ELSE
		RETURN 1

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_ADD]
GO
------------------------------------
--用途：增加一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_ADD
@BorrowBookID int output,
@BookID int,
@UserID int,
@StartTime nvarchar(50),
@EndTime nvarchar(50),
@Remark nvarchar(250)

 AS 
	INSERT INTO [TabBorrowBooks](
	[BookID],[UserID],[StartTime],[EndTime],[Remark]
	)VALUES(
	@BookID,@UserID,@StartTime,@EndTime,@Remark
	)
	SET @BorrowBookID = @@IDENTITY

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_Update]
GO
------------------------------------
--用途：修改一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_Update
@BorrowBookID int,
@BookID int,
@UserID int,
@StartTime nvarchar(50),
@EndTime nvarchar(50),
@Remark nvarchar(250)
 AS 
	UPDATE [TabBorrowBooks] SET 
	[BookID] = @BookID,[UserID] = @UserID,[StartTime] = @StartTime,[EndTime] = @EndTime,[Remark] = @Remark
	WHERE BorrowBookID=@BorrowBookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_Delete]
GO
------------------------------------
--用途：删除一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_Delete
@BorrowBookID int
 AS 
	DELETE [TabBorrowBooks]
	 WHERE BorrowBookID=@BorrowBookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_GetModel]
GO
------------------------------------
--用途：得到实体对象的详细信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_GetModel
@BorrowBookID int
 AS 
	SELECT 
	BorrowBookID,BookID,UserID,StartTime,EndTime,Remark
	 FROM [TabBorrowBooks]
	 WHERE BorrowBookID=@BorrowBookID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabBorrowBooks_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabBorrowBooks_GetList]
GO
------------------------------------
--用途：查询记录信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:17:46
------------------------------------
CREATE PROCEDURE UP_TabBorrowBooks_GetList
 AS 
	SELECT 
	BorrowBookID,BookID,UserID,StartTime,EndTime,Remark
	 FROM [TabBorrowBooks]

GO

/******************************************************************
* 表名：TabUser
* 时间：2010-4-16 17:18:29
* Made by Codematic
******************************************************************/

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_Exists]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_Exists]
GO
------------------------------------
--用途：是否已经存在 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_Exists
@UserID int
AS
	DECLARE @TempID int
	SELECT @TempID = count(1) FROM [TabUser] WHERE UserID=@UserID 
	IF @TempID = 0
		RETURN 0
	ELSE
		RETURN 1

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_ADD]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_ADD]
GO
------------------------------------
--用途：增加一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_ADD
@UserID int output,
@UserName nvarchar(50),
@UserPass nvarchar(50),
@Remark nvarchar(200)

 AS 
	INSERT INTO [TabUser](
	[UserName],[UserPass],[Remark]
	)VALUES(
	@UserName,@UserPass,@Remark
	)
	SET @UserID = @@IDENTITY

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_Update]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_Update]
GO
------------------------------------
--用途：修改一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_Update
@UserID int,
@UserName nvarchar(50),
@UserPass nvarchar(50),
@Remark nvarchar(200)
 AS 
	UPDATE [TabUser] SET 
	[UserName] = @UserName,[UserPass] = @UserPass,[Remark] = @Remark
	WHERE UserID=@UserID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_Delete]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_Delete]
GO
------------------------------------
--用途：删除一条记录 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_Delete
@UserID int
 AS 
	DELETE [TabUser]
	 WHERE UserID=@UserID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_GetModel]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_GetModel]
GO
------------------------------------
--用途：得到实体对象的详细信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_GetModel
@UserID int
 AS 
	SELECT 
	UserID,UserName,UserPass,Remark
	 FROM [TabUser]
	 WHERE UserID=@UserID 

GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UP_TabUser_GetList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[UP_TabUser_GetList]
GO
------------------------------------
--用途：查询记录信息 
--项目名称：lmis-leowl201004
--说明：
--时间：2010-4-16 17:18:29
------------------------------------
CREATE PROCEDURE UP_TabUser_GetList
 AS 
	SELECT 
	UserID,UserName,UserPass,Remark
	 FROM [TabUser]

GO



